<?php 
namespace Product\Model;

class Product
{
	public $ID_PR;
	public $NAME_PR;
	public $ID_PRT;
	public $CONTENT_PR;
	public $ACTIVE_PR;
	public $DATE_PR;
	public $HIGHLIGHT_PR;
	public $LINKIMG;
	public $AUTHOR;
	public $VIEW;
	
	public $namepro;
	public $producttypes;
	public $contentpro;
	public $activepro;	
	public $nameprosearch;

	public function exchangeArray($data)
	{
		$this->ID_PR     = (!empty($data['ID_PR'])) ? $data['ID_PR'] : null;
		$this->NAME_PR = (!empty($data['NAME_PR'])) ? $data['NAME_PR'] : null;
		$this->ID_PRT     = (!empty($data['ID_PRT'])) ? $data['ID_PRT'] : null;
		$this->CONTENT_PR = (!empty($data['CONTENT_PR'])) ? $data['CONTENT_PR'] : null;
		$this->ACTIVE_PR = (!empty($data['ACTIVE_PR'])) ? $data['ACTIVE_PR'] : null;
		$this->DATE_PR  = (!empty($data['DATE_PR'])) ? $data['DATE_PR'] : null;
		$this->HIGHLIGHT_PR  = (!empty($data['HIGHLIGHT_PR'])) ? $data['HIGHLIGHT_PR'] : null;
		$this->LINKIMG  = (!empty($data['LINKIMG'])) ? $data['LINKIMG'] : null;
		$this->AUTHOR  = (!empty($data['AUTHOR'])) ? $data['AUTHOR'] : null;
		$this->VIEW  = (!empty($data['VIEW'])) ? $data['VIEW'] : null;
	}
	
	// Add the following method:
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}
	
	public function addArray($data)
	{
		$this->namepro = (!empty($data['namepro'])) ? $data['namepro'] : null;
		$this->producttypes  = (!empty($data['producttypes'])) ? $data['producttypes'] : null;
		$this->contentpro = (!empty($data['contentpro'])) ? $data['contentpro'] : null;
		$this->activepro = (!empty($data['activepro'])) ? $data['activepro'] : null;
		$this->idproduct = (!empty($data['idproduct'])) ? $data['idproduct'] : null;
	}
	
	public function addsearch($data)
	{
		$this->nameprosearch = (!empty($data['nameprosearch'])) ? $data['nameprosearch'] : null;
	}
}